function myfunction() {
    document.getElementById("demo").innerHTML = "我是天才";
}

function date() {
    document.getElementById("demo").innerHTML = Date();
    <!--点击这里来显示日期和时间-->
}

function test() {
    var x, y, z;
    x = 22;
    y = 11;
    z = x + y;
    document.getElementById("demo").innerHTML = "z=" + z;
}

function numberfun() {
    var message, x;
    message = document.getElementById("p01");
    message.innerHTML = "";
    x = document.getElementById("demo").value;
    try {
        if (x == "") throw "是空的";
        if (isNaN(x)) throw "不是数字";
        x = Number(x);
        if (x < 5) throw "太小";
        if (x > 10) throw "太大";
    } catch (e) {
        message.innerHTML = "输入：" + e;
    }
}

// Person 对象的构造器函数
function Person(first, last, age, eye) {
    this.firstName = first;
    this.lastName = last;
    this.age = age;
    this.eyeColor = eye;
    this.name = function() {
        return this.firstName + " " + this.lastName;};
}